package com.lin.subject.infra.basic.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lin.subject.infra.basic.entity.SubjectCategory;
import com.lin.subject.infra.basic.entity.SubjectInfo;

import java.util.List;

/**
* @author jeremylin
* @description 针对表【subject_info(题目信息表)】的数据库操作Service
* @createDate 2024-10-21 11:12:25
*/
public interface SubjectInfoService extends IService<SubjectInfo> {

    void insert(SubjectInfo subjectInfo);

    /**
     * 查询对应题目的总数
     * @param subjectInfo
     * @param categoryId
     * @param labelId
     * @return
     */
    int countByCondition(SubjectInfo subjectInfo, Long categoryId, Long labelId);

    /**
     * 查询分页
     * @param subjectInfo
     * @param categoryId
     * @param labelId
     * @param start
     * @param pageSize
     * @return
     */
    List<SubjectInfo> queryPage(SubjectInfo subjectInfo, Long categoryId, Long labelId, int start, Integer pageSize);

    /**
     * 根据题目id，查询题目详情信息
     * @param id
     * @return
     */
    SubjectInfo queryById(Long id);

    int countByCondition2(SubjectInfo subjectInfo, Long categoryId);

    List<SubjectInfo> queryPage2(SubjectInfo subjectInfo, Long categoryId, int start, Integer pageSize);

    /**
     * 删除题目
     * @param id
     */
    void removeSubject(Long id);

    List<SubjectInfo> getContributeCount();

    Long querySubjectIdCursor(Long subjectId, Long categoryId, Long labelId, int i);
}
